package com.bbc.yuntun.web.core.config;


import com.bbc.yuntun.common.config.YuntunConfig;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * Swagger2的接口配置
 *
 * @author ruoyi
 */
@Configuration
@RequiredArgsConstructor
public class SwaggerConfig {

    /**
     * 根据@Tag 上的排序，写入x-order
     *
     * @return the global open api customizer
     */
    /*@Bean
    public GlobalOpenApiCustomizer orderGlobalOpenApiCustomizer() {
        return openApi -> {
        };
    }*/

    @Bean
    public OpenAPI customOpenAPI(YuntunConfig yuntunConfig) {
        return new OpenAPI()
                .info(new Info()
                        .title("标题：云吞短视频管理平台_接口文档")
                        .version("版本号:" + yuntunConfig.getVersion())
                        .description( "描述：用于管理和维护云吞短视频小程序，具体包括XXX，XXX模块..."));
    }

}
